<?php

    $pdo=new PDO("mysql:host=localhost;dbname=yongli","root","root");  

$sql="insert into km (km) values('2')";
$res=$pdo->exec($sql);
echo $res;